package cn.oi.book.pro.repository;

import cn.oi.book.pro.model.Knowledge;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

public interface KnowledgeRepository extends JpaRepository<Knowledge, Long>, JpaSpecificationExecutor<Knowledge> {
    java.util.List<Knowledge> findTop5ByCategoryAndIdNotOrderByUpdatedAtDesc(String category, Long excludeId);
    java.util.List<Knowledge> findTop5ByIdNotOrderByUpdatedAtDesc(Long excludeId);
}
